﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace NetFrameworkExtensions.DataLayer.EF4
{
  public abstract class DateTimeAuditableData<TIdentified, TIdentifier> :
    IdentifiedData<TIdentified, TIdentifier>,
    IDateTimeAuditableData
    where TIdentified : DateTimeAuditableData<TIdentified, TIdentifier>
    where TIdentifier : IEquatable<TIdentifier>
  {
    [Required]
    public virtual DateTime CreationDate { get; set; }

    [Required]
    public virtual DateTime ModificationDate { get; set; }

    public virtual DateTime? DeletionDate { get; set; }
  }

  public abstract class IdentityDateTimeAuditableData<TIdentified, TIdentifier> :
    IdentityIdentifiedData<TIdentified, TIdentifier>,
    IDateTimeAuditableData
    where TIdentified : IdentityDateTimeAuditableData<TIdentified, TIdentifier>
    where TIdentifier : IEquatable<TIdentifier>
  {
    [Required]
    public virtual DateTime CreationDate { get; set; }

    [Required]
    public virtual DateTime ModificationDate { get; set; }

    public virtual DateTime? DeletionDate { get; set; }
  }
}
